﻿/****************
* Authored by Zhuo "Wizcas" Chen
* 2018 © Wubi.fun all rights reserved
*****************/

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Tutorial : MonoBehaviour
{
    public void Show()
    {
        Game.instance.isInTutorial = true;
        Time.timeScale = 0;
        gameObject.SetActive(true);
        World.instance.Clear();
        for (var i = 0; i < 3; i++) {
            World.instance.AddBlock(new Vector2Int(0, 1), Block.Spawn("A"));
        }

        World.instance.AddBlock(new Vector2Int(2, 1), Block.Spawn("B"));
        World.instance.AddBlock(new Vector2Int(2, 2), Block.Spawn("B"));
        World.instance.AddBlock(new Vector2Int(2, 3), Block.Spawn("B"));

        World.instance.AddBlock(new Vector2Int(3, 4), Block.Spawn("C"));
        World.instance.AddBlock(new Vector2Int(4, 4), Block.Spawn("C"));
        World.instance.AddBlock(new Vector2Int(5, 4), Block.Spawn("C"));
        World.instance.AddBlock(new Vector2Int(4, 3), Block.Spawn("C"));
        World.instance.AddBlock(new Vector2Int(4, 5), Block.Spawn("C"));
    }

    public void Hide()
    {
        Game.instance.isInTutorial = false;
        World.instance.Clear();
        BlockQueue.instance.Regenerate();
        gameObject.SetActive(false);
        Time.timeScale = 1;
    }

    public void Next()
    {
        Hide();
    }
}
